home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / sc3x03.exe / GETFSINF.C < prev    next >
C/C++ Source or Header  |  1993-04-09  |  4KB  |  86 lines

  1. //   ╔════════════════════════════════════════════════════════════════════╗
  2. //   ║                                                                    ║
  3. //   ║ module:      getfsinf.c                                            ║
  4. //   ║ abstract:    This module shows how to make 3.x system calls using  ║
  5. //   ║              the F2 Shell Interface for the Get File Server        ║
  6. //   ║              Information API, obviously it requires the NetWare    ║
  7. //   ║              Shell.                                                ║
  8. //   ║                                                                    ║
  9. //   ║ environment: NetWare 3.x v3.11                                     ║
  10. //   ║              Borland C++ 3.1                                       ║
  11. //   ║                                                                    ║
  12. //   ║  This software is provided as is and carries no warranty           ║
  13. //   ║  whatsoever.  Novell disclaims and excludes any and all implied    ║
  14. //   ║  warranties of merchantability, title and fitness for a particular ║
  15. //   ║  purpose.  Novell does not warrant that the software will satisfy  ║
  16. //   ║  your requirements or that the software is without defect or error ║
  17. //   ║  or that operation of the software will be uninterrupted.  You are ║
  18. //   ║  using the software at your risk.  The software is not a product   ║
  19. //   ║  of Novell, Inc. or any of subsidiaries.                           ║
  20. //   ║                                                                    ║
  21. //   ╚════════════════════════════════════════════════════════════════════╝
  22. //
  23. //                         ****** N O T I C E ******
  24. //
  25. //     This software is considered pre-release and may be used at your own
  26. //     risk and has been provided due to the many requests of our cust-
  27. //     omers.  Support for this module will be provided at the sole
  28. //     discretion of Novell, Inc.
  29. //
  30.  
  31. #include <stdio.h>
  32. #include <string.h>
  33. #include <dos.h>
  34.  
  35. #include "nwsys.c"
  36.  
  37. struct REQ_BUFF {
  38.     WORD reqLen;          // Request Packet Length
  39.     BYTE subFunc;
  40. } reqBuff;
  41.  
  42. struct REP_BUFF {
  43.     BYTE serverName[48];
  44.     BYTE fsVersion;       // File Server Version
  45.     BYTE fsSubVersion;    // File Server Sub Version
  46.     WORD maxServConn;     // Maximum Supported Connections
  47.     WORD connInUse;       // Connections in Use
  48.     WORD numMountedVols;  // Number of Mounted Volumes
  49.     BYTE revision;        // File Server Revision
  50.     BYTE sftLevel;
  51.     BYTE ttsLevel;
  52.     WORD maxConnUsed;     // Max Connections Ever Used
  53.     BYTE accountVersion;  // Accounting Version Number
  54.     BYTE vapVersion;
  55.     BYTE queueVersion;    // QMS Version Number
  56.     BYTE printVersion;    // Print Server Version Number
  57.     BYTE vConsoleVersion; // Virtual Console Version
  58.     BYTE restrictLevel;   // Restriction Level
  59.     BYTE internetBridge;  // Internet Bridge Support Version Number
  60.     BYTE reserved[60];    // Reserved For Future Use
  61. } repBuff;
  62.  
  63. int main()
  64. {
  65.     int retCode;
  66.  
  67.     reqBuff.reqLen = 3;
  68.     reqBuff.subFunc = 0x11;
  69.  
  70.     retCode = NWSystemCall(0x17, &reqBuff, sizeof(struct REQ_BUFF),
  71.                                  &repBuff, sizeof(struct REP_BUFF));
  72.     if (retCode != 0) {
  73.         printf("Get File Server Information call failed.  Return code = %d.\n",
  74.             retCode);
  75.         return(1);
  76.     }
  77.     printf("Server %s, running NetWare version %d.%d (revision %d)\n",
  78.         repBuff.serverName, repBuff.fsVersion, repBuff.fsSubVersion,
  79.         repBuff.revision);
  80.     printf("Max supported connections: %u, Connections in use: %u\n",
  81.         repBuff.maxServConn, repBuff.connInUse);
  82.     printf("Max mounted volumes: %u, SFT level: %d, TTS level: %d\n",
  83.         repBuff.numMountedVols, repBuff.sftLevel, repBuff.ttsLevel);
  84.     return(0);
  85. }
  86.